package com.xiaoxing.salesclient.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.salesclient.mvp.ui.entity.HuoDongHuaXu;

import java.util.List;

import cn.iwgang.countdownview.CountdownView;
import xiaoxing.com.salesclient.R;


/**
 * Created by tad on 2017/11/16.
 */

public class HuoDongHuaXuAdapter extends BaseQuickAdapter<HuoDongHuaXu, BaseViewHolder> {
    private Context mContext;

    public HuoDongHuaXuAdapter(Context context, @Nullable List<HuoDongHuaXu> data) {
        super(R.layout.sales_client_listitem_huo_dong_hua_xu, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, HuoDongHuaXu item) {
        Glide.with(mContext).load(item.getImg_url()).into((ImageView) helper.getView(R.id.img_banner));
    }

    private void initCountdownView(BaseViewHolder viewHolder) {
        CountdownView mCvCountdownViewTest4 = (CountdownView) viewHolder.getView(R.id.cv_countdownView);
        long time4 = (long) 150 * 24 * 60 * 60 * 1000;
        mCvCountdownViewTest4.start(time4);
    }
}
